<template>
	<view class="content">
		<view class="m-top">
			<view class="txt">
				币种
			</view>
			<view class="txt1">
				{{symbol}}-{{contract_type}}
			</view>
		</view>
		<view class="car-body">
			<view class="ewm">
				<image :src="qrcode_path" mode="" class="ics"></image>
			</view>
			<view class="txt3">
				充币地址
			</view>
			<view class="txt4">
				{{address}}
			</view>
			<view class="btn" @click="copy(address)">
				<image src="../../../static/images/btn/fz.png" mode="aspectFit" class="icons"></image>
				<view class="txt5">
					复制地址
				</view>
			</view>
		</view>
		<view class="txt6">
			请勿向上述地址充值非任何{{symbol}}-{{contract_type}}资产，否则资产将不可找回！
		</view>
	
	</view>
</template>

<script>
	export default {
		data() {
			return {
				symbol:'',
				contract_type:'',
				address:'',
				qrcode_path:''
			}
		},
		onShow() {
			try {
				const currency = uni.getStorageSync('currency');
				if(currency){
					this.symbol= currency.symbol
					this.contract_type= currency.contract_type
				}
			} catch (e) {
			    // error
			}
			this.getAddress()
		},
		methods: {
			//复制地址
			copy(e){
				if(e){
					
					uni.setClipboardData({
					    data: e,
					    success: function () {
					        console.log('success');
					    }
					});
				}
			},
			// 获取地址
			getAddress(){
				this.$http({
					url:this.$api.recharge,
					method:'POST',
					hideLoading:true,
					data:{},
					success:res=>{
						console.log('详情----------',res)
						if(res.code==200){
							this.address = res.data.address
							this.qrcode_path = res.data.qrcode_path
						}
					},
					complete:e=>{
						uni.stopPullDownRefresh();
					}
				})
			}
		}
	}
</script>

<style scoped>
.content {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	background: #fff;
}
.m-top{
	font-weight: 600;
	color: #131415;
	line-height: 40rpx;
	height: 158rpx;
	border-bottom: 1px solid #F8F8F8;
	width: 100%;
	padding: 32rpx;
	display: flex;
	justify-content: center;
	flex-direction: column;
	align-items: flex-start;
	
}
.txt{
	font-size: 28rpx;
}
.txt1{
	margin-top: 24rpx;
	font-size: 24rpx;
}
.car-body{
	background: #007AFF;
	border-radius: 10px;
	width: 686rpx;
	height: 844rpx;
	margin: 42rpx auto;
	display: flex;
	align-items: center;
	flex-direction: column;
}
.ewm{
	width: 430rpx;
	height: 430rpx;
	background: #FFFFFF;
	margin: 92rpx auto 48rpx;
	
}
.ewm image{
	width: 100%;
	height: 100%;
}
.ics{
	width: 380rpx;
	height: 380rpx;
}

.txt3{
	font-size: 24rpx;
	font-weight: 600;
	color: #A8C6FF;
	line-height: 34rpx;
}
.txt4{
	font-size: 24rpx;
	font-weight: 600;
	color: #fff;
	line-height: 34rpx;
	margin-top: 10rpx;
	width: 560rpx;
	overflow-x: auto;
}
.btn{
	margin: 48rpx auto;
	width:160rpx ;
	height: 60rpx;
	border-radius: 32rpx;
	background: #fff;
	display: flex;
	justify-content: center;
	align-items: center;
}
.icons{
	width: 26rpx;
	height: 28rpx;
}
.txt5{
	font-size: 22rpx;
	font-weight: 400;
	color: #2F73FD;
	line-height: 32rpx;
	margin-left: 10rpx;
}
.txt6{
	font-size: 24rpx;
	font-weight: 400;
	color: #BBBBBB;
	line-height: 34rpx;
	width: 668rpx;
	margin: 0rpx auto;
}

</style>
